package com.motu.monstercity.server.game.logic;

import com.motu.monstercity.server.game.userdata.UserDating;
import com.motu.monstercity.server.game.userdata.UserDatingSecretary;
import com.motu.vertx.module.utility.model.EntityManager;
import com.motu.vertx.module.utility.model.Model;

import java.util.ArrayList;
import java.util.List;

public class DatingUserData extends DatingBaseData{

    public static UserDating getUserDating(long userId) {
        return (UserDating) EntityManager.getUniqueEntity(UserDating.class, userId);
    }

    public static List<UserDatingSecretary> getUserDatingSecretaryList(long userId){
        List<UserDatingSecretary> list = new ArrayList<>();
        for (Model model : EntityManager.getEntityList(UserDatingSecretary.class, userId)) {
            UserDatingSecretary entity = (UserDatingSecretary) model;
            list.add(entity);
        }
        return list;
    }

    public static UserDatingSecretary getUserDatingSecretary(long userId, long id) {
        return (UserDatingSecretary) EntityManager.getEntity(UserDatingSecretary.class, userId, id);
    }
}
